package indexer;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

/**
 * @author Pascal de Vink
 * @version 0.3
 */
public class Settings {
	
	public boolean getSettings(File file) 
	{
	    try{
	        Properties p = new Properties();
	        p.load(new FileInputStream(file));
	        Dispatcher.PATH = p.getProperty("path");
		    Dispatcher.SQLURL = p.getProperty("dburl");
		    Dispatcher.SQLUSER = p.getProperty("dbuser");
		    Dispatcher.SQLPASS = p.getProperty("dbpass");
		    Dispatcher.LOG = p.getProperty("logging");
		    Dispatcher.LOGFILE = p.getProperty("logpath");
		    return true;
	    }
	    catch (Exception e) {
	    	System.out.println(e);
	    	return false;
	    }
	}
}
